function [command coordinates]=getCommand(board)
  global END_GAME;
  global CONTINUE;
  global WIN_GAME;
  
  CONTINUE=1;
  END_GAME=-1;
  WIN_GAME=2;
  
  validCommand=0;
  command=CONTINUE;
  
  coordinates=[];
  
  while(~validCommand)
      s= input('Table position: ','s');

      if(strcmp(s,'C'))
          command=END_GAME;
          validCommand=1;
          display('cancel game');
      else
          values=str2num(s);
          
          if(size(values,2)==2 && isempty(find(values>3)) && isempty(find(values<1)))
              if(~(board(values(1),values(2))==0))
                  display('cell not empty');
              else
                  coordinates=values;
                  validCommand=1;
              end
          else
              display('invalid position')
          end
      end
  end
  
end